package com.javalei.api;

import com.javalei.dao.UserMapper;
import com.javalei.pojo.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;


@Controller
//@SessionAttributes(User)
public class UserLogin {
    @Autowired
  private  UserMapper userMapper;
    @RequestMapping("/test")
    @ResponseBody
    public String Login(String name,String pwd){
        System.out.println("name"+name+"pwd"+pwd);
        //System.out.println("name"+name+"pwd"+pwd);
      User u=userMapper.selectbypwd(name,pwd);
      if(u!=null)
        return  "1";
      else
          return "0";
}
}
